<h2 align="center"><%= @user.login %></h2>
<div id="user-profile" class="subsection">
  <h2>User Profile</h2>
  <table border="0" cellpadding="0" cellspacing="0">
    <tr valign="top">
      <td class="row_header">Name</td>
      <td class="row_value"><%= @user.full_name %></td>
    </tr>
    <tr valign="top">
      <td class="row_header">Last logged in</td>
      <td class="row_value"><%= @user.lastlogin.to_s(:long) %></td>
    </tr>
    <tr valign="top">
      <td class="row_header">Signed up on</td>
      <td class="row_value"><%= @user.created_at.to_s(:long) %></td>
    </tr>
  </table>

  <div id="user_photos">
    <h2>Photos</h2>
    <% photo_count = Photo.count(["user_id = ?", @user]) %>
    <b><%=@user.login%></b>&nbsp;has submitted <%= photo_count %> photos.<p>
    <%= render :partial=>"gallery/photo", :collection=>@user.photos %>
  </div>

  <div id="user_critiques" style="clear:both">
    <h2>Critiques</h2>
    <% critique_count = Critique.count(["user_id = ?", @user]) %>
    <b><%=@user.login%></b>&nbsp;has critiqued <%= critique_count %> photos.<p>
    <% if critique_count > 0 -%>
      <table border="0" cellpadding="0" cellspacing="0">
        <tr valign="top">
          <%= render :partial=>"critiques/critique_in_row", :collection=>@user.critiques %>
        </tr>
      </table>
    <% end -%>
  </div>

</div>
